(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
mod(x, 0) → modZeroErro
mod(x, s(y)) → modIter(x, s(y), 0, 0)
modIter(x, s(y), z, u) → if(le(x, z), x, s(y), z, u)
if(true, x, y, z, u) → u
if(false, x, y, z, u) → if2(le(y, s(u)), x, y, s(z), s(u))
if2(false, x, y, z, u) → modIter(x, y, z, u)
if2(true, x, y, z, u) → modIter(x, y, z, 0)

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

le(0, y) → true [1]
le(s(x), 0) → false [1]
le(s(x), s(y)) → le(x, y) [1]
mod(x, 0) → modZeroErro [1]
mod(x, s(y)) → modIter(x, s(y), 0, 0) [1]
modIter(x, s(y), z, u) → if(le(x, z), x, s(y), z, u) [1]
if(true, x, y, z, u) → u [1]
if(false, x, y, z, u) → if2(le(y, s(u)), x, y, s(z), s(u)) [1]
if2(false, x, y, z, u) → modIter(x, y, z, u) [1]
if2(true, x, y, z, u) → modIter(x, y, z, 0) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

le(0, y) → true [1]
le(s(x), 0) → false [1]
le(s(x), s(y)) → le(x, y) [1]
mod(x, 0) → modZeroErro [1]
mod(x, s(y)) → modIter(x, s(y), 0, 0) [1]
modIter(x, s(y), z, u) → if(le(x, z), x, s(y), z, u) [1]
if(true, x, y, z, u) → u [1]
if(false, x, y, z, u) → if2(le(y, s(u)), x, y, s(z), s(u)) [1]
if2(false, x, y, z, u) → modIter(x, y, z, u) [1]
if2(true, x, y, z, u) → modIter(x, y, z, 0) [1]

The TRS has the following type information:
le :: 0:s:modZeroErro → 0:s:modZeroErro → true:false
0 :: 0:s:modZeroErro
true :: true:false
s :: 0:s:modZeroErro → 0:s:modZeroErro
false :: true:false
mod :: 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro
modZeroErro :: 0:s:modZeroErro
modIter :: 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro
if :: true:false → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro
if2 :: true:false → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro → 0:s:modZeroErro

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:

le(v0, v1) → null_le [0]
mod(v0, v1) → null_mod [0]
modIter(v0, v1, v2, v3) → null_modIter [0]
if(v0, v1, v2, v3, v4) → null_if [0]
if2(v0, v1, v2, v3, v4) → null_if2 [0]

And the following fresh constants:

null_le, null_mod, null_modIter, null_if, null_if2

(6) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

le(0, y) → true [1]
le(s(x), 0) → false [1]
le(s(x), s(y)) → le(x, y) [1]
mod(x, 0) → modZeroErro [1]
mod(x, s(y)) → modIter(x, s(y), 0, 0) [1]
modIter(x, s(y), z, u) → if(le(x, z), x, s(y), z, u) [1]
if(true, x, y, z, u) → u [1]
if(false, x, y, z, u) → if2(le(y, s(u)), x, y, s(z), s(u)) [1]
if2(false, x, y, z, u) → modIter(x, y, z, u) [1]
if2(true, x, y, z, u) → modIter(x, y, z, 0) [1]
le(v0, v1) → null_le [0]
mod(v0, v1) → null_mod [0]
modIter(v0, v1, v2, v3) → null_modIter [0]
if(v0, v1, v2, v3, v4) → null_if [0]
if2(v0, v1, v2, v3, v4) → null_if2 [0]

The TRS has the following type information:
le :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → true:false:null_le
0 :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
true :: true:false:null_le
s :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
false :: true:false:null_le
mod :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
modZeroErro :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
modIter :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
if :: true:false:null_le → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
if2 :: true:false:null_le → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2 → 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
null_le :: true:false:null_le
null_mod :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
null_modIter :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
null_if :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2
null_if2 :: 0:s:modZeroErro:null_mod:null_modIter:null_if:null_if2

Rewrite Strategy: INNERMOST

(7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
true => 2
false => 1
modZeroErro => 1
null_le => 0
null_mod => 0
null_modIter => 0
null_if => 0
null_if2 => 0

(8) Obligation:

Complexity RNTS consisting of the following rules:

if(z', z'', z1, z2, z3) -{ 1 }→ u :|: z1 = y, z >= 0, z' = 2, z2 = z, x >= 0, y >= 0, z'' = x, z3 = u, u >= 0
if(z', z'', z1, z2, z3) -{ 1 }→ if2(le(y, 1 + u), x, y, 1 + z, 1 + u) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1, z3 = u, u >= 0
if(z', z'', z1, z2, z3) -{ 0 }→ 0 :|: z2 = v3, v0 >= 0, v4 >= 0, z1 = v2, v1 >= 0, z'' = v1, z3 = v4, v2 >= 0, v3 >= 0, z' = v0
if2(z', z'', z1, z2, z3) -{ 1 }→ modIter(x, y, z, u) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1, z3 = u, u >= 0
if2(z', z'', z1, z2, z3) -{ 1 }→ modIter(x, y, z, 0) :|: z1 = y, z >= 0, z' = 2, z2 = z, x >= 0, y >= 0, z'' = x, z3 = u, u >= 0
if2(z', z'', z1, z2, z3) -{ 0 }→ 0 :|: z2 = v3, v0 >= 0, v4 >= 0, z1 = v2, v1 >= 0, z'' = v1, z3 = v4, v2 >= 0, v3 >= 0, z' = v0
le(z', z'') -{ 1 }→ le(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y
le(z', z'') -{ 1 }→ 2 :|: z'' = y, y >= 0, z' = 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' = 1 + x, x >= 0
le(z', z'') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0
mod(z', z'') -{ 1 }→ modIter(x, 1 + y, 0, 0) :|: z' = x, x >= 0, y >= 0, z'' = 1 + y
mod(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' = x, x >= 0
mod(z', z'') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0
modIter(z', z'', z1, z2) -{ 1 }→ if(le(x, z), x, 1 + y, z, u) :|: z1 = z, z2 = u, z >= 0, z' = x, x >= 0, y >= 0, z'' = 1 + y, u >= 0
modIter(z', z'', z1, z2) -{ 0 }→ 0 :|: z2 = v3, v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, v3 >= 0, z' = v0

Only complete derivations are relevant for the runtime complexity.

(9) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V, V1, V9, V10, V15),0,[le(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1, V9, V10, V15),0,[mod(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1, V9, V10, V15),0,[modIter(V, V1, V9, V10, Out)],[V >= 0,V1 >= 0,V9 >= 0,V10 >= 0]).
eq(start(V, V1, V9, V10, V15),0,[if(V, V1, V9, V10, V15, Out)],[V >= 0,V1 >= 0,V9 >= 0,V10 >= 0,V15 >= 0]).
eq(start(V, V1, V9, V10, V15),0,[if2(V, V1, V9, V10, V15, Out)],[V >= 0,V1 >= 0,V9 >= 0,V10 >= 0,V15 >= 0]).
eq(le(V, V1, Out),1,[],[Out = 2,V1 = V2,V2 >= 0,V = 0]).
eq(le(V, V1, Out),1,[],[Out = 1,V1 = 0,V = 1 + V3,V3 >= 0]).
eq(le(V, V1, Out),1,[le(V4, V5, Ret)],[Out = Ret,V = 1 + V4,V4 >= 0,V5 >= 0,V1 = 1 + V5]).
eq(mod(V, V1, Out),1,[],[Out = 1,V1 = 0,V = V6,V6 >= 0]).
eq(mod(V, V1, Out),1,[modIter(V7, 1 + V8, 0, 0, Ret1)],[Out = Ret1,V = V7,V7 >= 0,V8 >= 0,V1 = 1 + V8]).
eq(modIter(V, V1, V9, V10, Out),1,[le(V11, V12, Ret0),if(Ret0, V11, 1 + V13, V12, V14, Ret2)],[Out = Ret2,V9 = V12,V10 = V14,V12 >= 0,V = V11,V11 >= 0,V13 >= 0,V1 = 1 + V13,V14 >= 0]).
eq(if(V, V1, V9, V10, V15, Out),1,[],[Out = V16,V9 = V17,V18 >= 0,V = 2,V10 = V18,V19 >= 0,V17 >= 0,V1 = V19,V15 = V16,V16 >= 0]).
eq(if(V, V1, V9, V10, V15, Out),1,[le(V20, 1 + V21, Ret01),if2(Ret01, V22, V20, 1 + V23, 1 + V21, Ret3)],[Out = Ret3,V9 = V20,V23 >= 0,V10 = V23,V22 >= 0,V20 >= 0,V1 = V22,V = 1,V15 = V21,V21 >= 0]).
eq(if2(V, V1, V9, V10, V15, Out),1,[modIter(V24, V25, V26, V27, Ret4)],[Out = Ret4,V9 = V25,V26 >= 0,V10 = V26,V24 >= 0,V25 >= 0,V1 = V24,V = 1,V15 = V27,V27 >= 0]).
eq(if2(V, V1, V9, V10, V15, Out),1,[modIter(V28, V29, V30, 0, Ret5)],[Out = Ret5,V9 = V29,V30 >= 0,V = 2,V10 = V30,V28 >= 0,V29 >= 0,V1 = V28,V15 = V31,V31 >= 0]).
eq(le(V, V1, Out),0,[],[Out = 0,V32 >= 0,V33 >= 0,V1 = V33,V = V32]).
eq(mod(V, V1, Out),0,[],[Out = 0,V34 >= 0,V35 >= 0,V1 = V35,V = V34]).
eq(modIter(V, V1, V9, V10, Out),0,[],[Out = 0,V10 = V36,V37 >= 0,V9 = V38,V39 >= 0,V1 = V39,V38 >= 0,V36 >= 0,V = V37]).
eq(if(V, V1, V9, V10, V15, Out),0,[],[Out = 0,V10 = V40,V41 >= 0,V42 >= 0,V9 = V43,V44 >= 0,V1 = V44,V15 = V42,V43 >= 0,V40 >= 0,V = V41]).
eq(if2(V, V1, V9, V10, V15, Out),0,[],[Out = 0,V10 = V45,V46 >= 0,V47 >= 0,V9 = V48,V49 >= 0,V1 = V49,V15 = V47,V48 >= 0,V45 >= 0,V = V46]).
input_output_vars(le(V,V1,Out),[V,V1],[Out]).
input_output_vars(mod(V,V1,Out),[V,V1],[Out]).
input_output_vars(modIter(V,V1,V9,V10,Out),[V,V1,V9,V10],[Out]).
input_output_vars(if(V,V1,V9,V10,V15,Out),[V,V1,V9,V10,V15],[Out]).
input_output_vars(if2(V,V1,V9,V10,V15,Out),[V,V1,V9,V10,V15],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. recursive : [le/3]
1. recursive : [if/6,if2/6,modIter/5]
2. non_recursive : [ (mod)/3]
3. non_recursive : [start/5]

#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into le/3
1. SCC is partially evaluated into modIter/5
2. SCC is partially evaluated into (mod)/3
3. SCC is partially evaluated into start/5

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations le/3
* CE 15 is refined into CE [25]
* CE 13 is refined into CE [26]
* CE 12 is refined into CE [27]
* CE 14 is refined into CE [28]


### Cost equations --> "Loop" of le/3
* CEs [28] --> Loop 14
* CEs [25] --> Loop 15
* CEs [26] --> Loop 16
* CEs [27] --> Loop 17

### Ranking functions of CR le(V,V1,Out)
* RF of phase [14]: [V,V1]

#### Partial ranking functions of CR le(V,V1,Out)
* Partial RF of phase [14]:
- RF of loop [14:1]:
V
V1


### Specialization of cost equations modIter/5
* CE 20 is refined into CE [29,30]
* CE 16 is refined into CE [31,32,33,34,35,36]
* CE 19 is refined into CE [37,38,39,40,41]
* CE 21 is refined into CE [42]
* CE 18 is refined into CE [43,44]
* CE 17 is refined into CE [45,46]


### Cost equations --> "Loop" of modIter/5
* CEs [44] --> Loop 18
* CEs [46] --> Loop 19
* CEs [43] --> Loop 20
* CEs [45] --> Loop 21
* CEs [30] --> Loop 22
* CEs [31,32,33,38] --> Loop 23
* CEs [29] --> Loop 24
* CEs [34,35,36,37,39,40,41,42] --> Loop 25

### Ranking functions of CR modIter(V,V1,V9,V10,Out)
* RF of phase [18,19]: [V-V9]

#### Partial ranking functions of CR modIter(V,V1,V9,V10,Out)
* Partial RF of phase [18,19]:
- RF of loop [18:1]:
V1-V10-1 depends on loops [19:1]
- RF of loop [18:1,19:1]:
V-V9


### Specialization of cost equations (mod)/3
* CE 23 is refined into CE [47,48,49,50,51]
* CE 24 is refined into CE [52]
* CE 22 is refined into CE [53]


### Cost equations --> "Loop" of (mod)/3
* CEs [50] --> Loop 26
* CEs [51] --> Loop 27
* CEs [53] --> Loop 28
* CEs [49] --> Loop 29
* CEs [47,48,52] --> Loop 30

### Ranking functions of CR mod(V,V1,Out)

#### Partial ranking functions of CR mod(V,V1,Out)


### Specialization of cost equations start/5
* CE 5 is refined into CE [54,55,56,57,58,59,60]
* CE 8 is refined into CE [61]
* CE 2 is refined into CE [62,63,64,65]
* CE 3 is refined into CE [66]
* CE 4 is refined into CE [67,68,69,70,71]
* CE 6 is refined into CE [72,73,74,75]
* CE 7 is refined into CE [76,77,78,79,80,81,82]
* CE 9 is refined into CE [83,84,85,86,87]
* CE 10 is refined into CE [88,89,90,91]
* CE 11 is refined into CE [92,93,94,95,96,97,98]


### Cost equations --> "Loop" of start/5
* CEs [95] --> Loop 31
* CEs [96] --> Loop 32
* CEs [84,89] --> Loop 33
* CEs [57] --> Loop 34
* CEs [58] --> Loop 35
* CEs [56] --> Loop 36
* CEs [54,55,59,60,61] --> Loop 37
* CEs [79] --> Loop 38
* CEs [80] --> Loop 39
* CEs [88,94] --> Loop 40
* CEs [62,67] --> Loop 41
* CEs [78] --> Loop 42
* CEs [63,64,65,68,69,70,71,72,73,74,75,76,77,81,82] --> Loop 43
* CEs [66,83,85,86,87,90,91,92,93,97,98] --> Loop 44

### Ranking functions of CR start(V,V1,V9,V10,V15)

#### Partial ranking functions of CR start(V,V1,V9,V10,V15)


Computing Bounds
=====================================

#### Cost of chains of le(V,V1,Out):
* Chain [[14],17]: 1*it(14)+1
Such that:it(14) =< V

with precondition: [Out=2,V>=1,V1>=V]

* Chain [[14],16]: 1*it(14)+1
Such that:it(14) =< V1

with precondition: [Out=1,V1>=1,V>=V1+1]

* Chain [[14],15]: 1*it(14)+0
Such that:it(14) =< V1

with precondition: [Out=0,V>=1,V1>=1]

* Chain [17]: 1
with precondition: [V=0,Out=2,V1>=0]

* Chain [16]: 1
with precondition: [V1=0,Out=1,V>=1]

* Chain [15]: 0
with precondition: [Out=0,V>=0,V1>=0]


#### Cost of chains of modIter(V,V1,V9,V10,Out):
* Chain [[18,19],25]: 10*it(18)+6*s(2)+3*s(3)+1*s(7)+1*s(19)+1*s(20)+1*s(21)+4
Such that:s(7) =< V1
aux(13) =< V1+V10
aux(14) =< V
aux(15) =< V-V9
aux(16) =< V-V9+V10+1
s(2) =< aux(14)
s(3) =< aux(16)
it(18) =< aux(15)
aux(7) =< aux(14)
s(21) =< it(18)*aux(7)
s(20) =< it(18)*aux(13)
s(19) =< it(18)*aux(14)

with precondition: [Out=0,V1>=1,V9>=1,V10>=0,V>=V9+1]

* Chain [[18,19],22]: 10*it(18)+1*s(19)+1*s(20)+1*s(21)+1*s(22)+1*s(23)+3
Such that:s(22) =< V-V9+V10-Out
aux(13) =< V1+V10
aux(17) =< V
aux(18) =< V-V9
s(23) =< aux(17)
it(18) =< aux(18)
aux(7) =< aux(17)
s(21) =< it(18)*aux(7)
s(20) =< it(18)*aux(13)
s(19) =< it(18)*aux(17)

with precondition: [V9>=1,V10>=0,Out>=0,V>=V9+1,V1>=Out+1,V+V10>=Out+V9]

* Chain [25]: 5*s(2)+2*s(3)+1*s(7)+1*s(10)+4
Such that:s(10) =< V
s(7) =< V1
aux(1) =< V9
aux(2) =< V10+1
s(2) =< aux(1)
s(3) =< aux(2)

with precondition: [Out=0,V>=0,V1>=0,V9>=0,V10>=0]

* Chain [24]: 3
with precondition: [V=0,V10=Out,V1>=1,V9>=0,V10>=0]

* Chain [23]: 2*s(24)+1*s(26)+4
Such that:s(26) =< V1
aux(19) =< V10+1
s(24) =< aux(19)

with precondition: [V9=0,Out=0,V>=1,V1>=1,V10>=0]

* Chain [22]: 1*s(23)+3
Such that:s(23) =< V

with precondition: [V10=Out,V>=1,V1>=1,V10>=0,V9>=V]

* Chain [21,[18,19],25]: 19*it(18)+2*s(7)+1*s(19)+1*s(20)+1*s(21)+9
Such that:aux(20) =< V
aux(21) =< V1
s(7) =< aux(21)
it(18) =< aux(20)
aux(7) =< aux(20)
s(21) =< it(18)*aux(7)
s(20) =< it(18)*aux(21)
s(19) =< it(18)*aux(20)

with precondition: [V9=0,Out=0,V>=2,V1>=1,V10+1>=V1]

* Chain [21,[18,19],22]: 11*it(18)+1*s(19)+1*s(20)+1*s(21)+1*s(22)+1*s(27)+8
Such that:s(22) =< V-Out
aux(22) =< V
aux(23) =< V1
s(27) =< aux(23)
it(18) =< aux(22)
aux(7) =< aux(22)
s(21) =< it(18)*aux(7)
s(20) =< it(18)*aux(23)
s(19) =< it(18)*aux(22)

with precondition: [V9=0,V>=2,Out>=0,V10+1>=V1,V>=Out+1,V1>=Out+1]

* Chain [21,25]: 7*s(2)+2*s(7)+1*s(10)+9
Such that:s(10) =< V
aux(24) =< 1
aux(25) =< V1
s(7) =< aux(25)
s(2) =< aux(24)

with precondition: [V9=0,Out=0,V>=1,V1>=1,V10+1>=V1]

* Chain [21,22]: 1*s(23)+1*s(27)+8
Such that:s(23) =< 1
s(27) =< V1

with precondition: [V=1,V9=0,Out=0,V1>=1,V10+1>=V1]

* Chain [20,[18,19],25]: 16*it(18)+3*s(3)+1*s(7)+1*s(19)+1*s(20)+1*s(21)+1*s(28)+9
Such that:aux(16) =< V+V10+1
s(7) =< V1
aux(13) =< V1+V10+1
s(28) =< V10+1
aux(26) =< V
it(18) =< aux(26)
s(3) =< aux(16)
aux(7) =< aux(26)
s(21) =< it(18)*aux(7)
s(20) =< it(18)*aux(13)
s(19) =< it(18)*aux(26)

with precondition: [V9=0,Out=0,V>=2,V10>=0,V1>=V10+2]

* Chain [20,[18,19],22]: 11*it(18)+1*s(19)+1*s(20)+1*s(21)+1*s(22)+1*s(28)+8
Such that:s(22) =< V+V10-Out
aux(13) =< V1+V10+1
s(28) =< V10+1
aux(27) =< V
it(18) =< aux(27)
aux(7) =< aux(27)
s(21) =< it(18)*aux(7)
s(20) =< it(18)*aux(13)
s(19) =< it(18)*aux(27)

with precondition: [V9=0,V>=2,V10>=0,Out>=0,V1>=V10+2,V1>=Out+1,V+V10>=Out]

* Chain [20,25]: 5*s(2)+2*s(3)+1*s(7)+1*s(10)+1*s(28)+9
Such that:aux(1) =< 1
s(10) =< V
s(7) =< V1
s(28) =< V10+1
aux(2) =< V10+2
s(2) =< aux(1)
s(3) =< aux(2)

with precondition: [V9=0,Out=0,V>=1,V10>=0,V1>=V10+2]

* Chain [20,22]: 1*s(23)+1*s(28)+8
Such that:s(23) =< 1
s(28) =< Out

with precondition: [V=1,V9=0,V10+1=Out,V10>=0,V1>=V10+2]


#### Cost of chains of mod(V,V1,Out):
* Chain [30]: 19*s(94)+54*s(95)+10*s(96)+2*s(98)+3*s(100)+2*s(101)+3*s(102)+6*s(104)+1*s(105)+10
Such that:aux(32) =< 1
s(89) =< 2
aux(33) =< V
aux(34) =< V+1
aux(35) =< V1
s(87) =< V1+1
s(94) =< aux(32)
s(95) =< aux(33)
s(96) =< aux(35)
s(98) =< s(89)
s(99) =< aux(33)
s(100) =< s(95)*s(99)
s(101) =< s(95)*aux(35)
s(102) =< s(95)*aux(33)
s(104) =< aux(34)
s(105) =< s(95)*s(87)

with precondition: [Out=0,V>=0,V1>=0]

* Chain [29]: 2*s(111)+9
Such that:aux(36) =< 1
s(111) =< aux(36)

with precondition: [V=1,Out=1,V1>=2]

* Chain [28]: 1
with precondition: [V1=0,Out=1,V>=0]

* Chain [27]: 12*s(113)+1*s(116)+1*s(119)+1*s(120)+1*s(121)+9
Such that:s(115) =< 1
aux(37) =< V
s(113) =< aux(37)
s(116) =< s(115)
s(118) =< aux(37)
s(119) =< s(113)*s(118)
s(120) =< s(113)*s(115)
s(121) =< s(113)*aux(37)

with precondition: [V1=1,Out=0,V>=2]

* Chain [26]: 12*s(122)+1*s(124)+1*s(128)+1*s(129)+1*s(130)+9
Such that:s(124) =< 1
s(123) =< V1+1
aux(38) =< V
s(122) =< aux(38)
s(127) =< aux(38)
s(128) =< s(122)*s(127)
s(129) =< s(122)*s(123)
s(130) =< s(122)*aux(38)

with precondition: [V>=2,V1>=2,Out>=0,V>=Out,V1>=Out+1]


#### Cost of chains of start(V,V1,V9,V10,V15):
* Chain [44]: 22*s(155)+125*s(157)+34*s(165)+7*s(167)+1*s(168)+7*s(169)+2*s(171)+3*s(172)+6*s(173)+2*s(174)+6*s(197)+2*s(198)+5*s(203)+3*s(204)+1*s(205)+3*s(206)+20*s(207)+2*s(208)+2*s(209)+2*s(210)+1*s(212)+10
Such that:s(158) =< 2
s(159) =< V+1
s(212) =< V-V9+V10
s(184) =< V-V9+V10+1
s(185) =< V+V10+1
s(187) =< V1+V10+1
s(188) =< V9
s(193) =< V10+1
s(189) =< V10+2
aux(41) =< 1
aux(42) =< V
aux(43) =< V-V9
aux(44) =< V1
aux(45) =< V1+1
aux(46) =< V1+V10
s(165) =< aux(41)
s(157) =< aux(42)
s(155) =< aux(44)
s(166) =< aux(42)
s(167) =< s(157)*s(166)
s(168) =< s(157)*aux(41)
s(169) =< s(157)*aux(42)
s(171) =< s(158)
s(172) =< s(157)*aux(44)
s(173) =< s(159)
s(174) =< s(157)*aux(45)
s(197) =< s(193)
s(198) =< s(189)
s(203) =< s(188)
s(204) =< s(185)
s(205) =< s(157)*s(187)
s(206) =< s(184)
s(207) =< aux(43)
s(208) =< s(207)*s(166)
s(209) =< s(207)*aux(46)
s(210) =< s(207)*aux(42)

with precondition: [V>=0,V1>=0]

* Chain [43]: 12*s(222)+35*s(224)+45*s(238)+138*s(239)+2*s(242)+6*s(244)+3*s(245)+6*s(246)+10*s(247)+3*s(248)+1*s(249)+64*s(250)+6*s(252)+2*s(253)+6*s(254)+8*s(284)+2*s(285)+3*s(291)+1*s(292)+6*s(293)+2*s(296)+2*s(301)+5*s(331)+3*s(332)+1*s(333)+2*s(337)+12
Such that:s(233) =< 2
s(229) =< V1+1
s(313) =< V1+V15+1
s(272) =< V1+V15+2
s(231) =< V9+1
s(274) =< V9+V15+2
s(316) =< V10
s(276) =< V15+3
aux(52) =< 1
aux(53) =< V1
aux(54) =< V1-V10
aux(55) =< V1-V10+V15
aux(56) =< V1-V10+V15+1
aux(57) =< V9
aux(58) =< V9+V15
aux(59) =< V9+V15+1
aux(60) =< V10+1
aux(61) =< V15+1
aux(62) =< V15+2
s(239) =< aux(53)
s(301) =< aux(55)
s(224) =< aux(57)
s(222) =< aux(61)
s(238) =< aux(52)
s(284) =< aux(62)
s(285) =< s(276)
s(243) =< aux(53)
s(244) =< s(239)*s(243)
s(245) =< s(239)*aux(57)
s(246) =< s(239)*aux(53)
s(247) =< aux(60)
s(291) =< s(272)
s(292) =< s(239)*s(274)
s(293) =< aux(56)
s(250) =< aux(54)
s(252) =< s(250)*s(243)
s(296) =< s(250)*aux(59)
s(254) =< s(250)*aux(53)
s(331) =< s(316)
s(332) =< s(313)
s(333) =< s(239)*aux(59)
s(337) =< s(250)*aux(58)
s(242) =< s(233)
s(248) =< s(229)
s(249) =< s(239)*s(231)
s(253) =< s(250)*aux(57)

with precondition: [V=1,V1>=0,V9>=0,V10>=0,V15>=0]

* Chain [42]: 1*s(350)+1*s(351)+9
Such that:s(350) =< 1
s(351) =< V15+1

with precondition: [V=1,V1=1,V10=0,V15>=0,V9>=V15+2]

* Chain [41]: 19*s(363)+44*s(364)+2*s(367)+2*s(369)+2*s(371)+5*s(372)+3*s(373)+1*s(374)+13*s(375)+1*s(377)+1*s(379)+12
Such that:aux(64) =< 1
s(358) =< 2
s(360) =< V1
s(354) =< V1+1
aux(65) =< V1-V10
s(357) =< V10+1
s(363) =< aux(64)
s(364) =< s(360)
s(367) =< s(358)
s(368) =< s(360)
s(369) =< s(364)*s(368)
s(371) =< s(364)*s(360)
s(372) =< s(357)
s(373) =< s(354)
s(374) =< s(364)*aux(64)
s(375) =< aux(65)
s(377) =< s(375)*s(368)
s(379) =< s(375)*s(360)

with precondition: [V=1,V9=0,V1>=0,V10>=0,V15>=0]

* Chain [40]: 3*s(381)+1*s(383)+9
Such that:s(383) =< V10+1
aux(66) =< 1
s(381) =< aux(66)

with precondition: [V=1,V1>=2]

* Chain [39]: 12*s(384)+1*s(387)+1*s(390)+1*s(391)+1*s(392)+9
Such that:s(386) =< V9
aux(67) =< V1
s(384) =< aux(67)
s(387) =< s(386)
s(389) =< aux(67)
s(390) =< s(384)*s(389)
s(391) =< s(384)*s(386)
s(392) =< s(384)*aux(67)

with precondition: [V=1,V10=0,V1>=2,V9>=1,V15+1>=V9]

* Chain [38]: 1*s(393)+1*s(395)+11*s(397)+1*s(399)+1*s(400)+1*s(401)+9
Such that:s(396) =< V1
s(393) =< V1+V15
s(394) =< V9+V15+1
s(395) =< V15+1
s(397) =< s(396)
s(398) =< s(396)
s(399) =< s(397)*s(398)
s(400) =< s(397)*s(394)
s(401) =< s(397)*s(396)

with precondition: [V=1,V10=0,V1>=2,V15>=0,V9>=V15+2]

* Chain [37]: 19*s(413)+46*s(414)+10*s(415)+2*s(417)+2*s(419)+1*s(420)+2*s(421)+5*s(422)+3*s(423)+1*s(424)+3*s(425)+21*s(426)+2*s(427)+2*s(428)+2*s(429)+10
Such that:aux(68) =< 1
s(408) =< 2
s(404) =< V1+1
s(403) =< V1-V10+1
s(406) =< V9+1
s(407) =< V10
aux(71) =< V1
aux(72) =< V1-V10
aux(73) =< V9
s(414) =< aux(71)
s(413) =< aux(68)
s(415) =< aux(73)
s(417) =< s(408)
s(418) =< aux(71)
s(419) =< s(414)*s(418)
s(420) =< s(414)*aux(73)
s(421) =< s(414)*aux(71)
s(422) =< s(407)
s(423) =< s(404)
s(424) =< s(414)*s(406)
s(425) =< s(403)
s(426) =< aux(72)
s(427) =< s(426)*s(418)
s(428) =< s(426)*aux(73)
s(429) =< s(426)*aux(71)

with precondition: [V=2,V1>=0,V9>=0,V10>=0,V15>=0]

* Chain [36]: 2*s(441)+9
Such that:aux(74) =< 1
s(441) =< aux(74)

with precondition: [V=2,V1=1,V10=0,V9>=2,V15>=0]

* Chain [35]: 12*s(443)+1*s(446)+1*s(449)+1*s(450)+1*s(451)+9
Such that:s(445) =< 1
aux(75) =< V1
s(443) =< aux(75)
s(446) =< s(445)
s(448) =< aux(75)
s(449) =< s(443)*s(448)
s(450) =< s(443)*s(445)
s(451) =< s(443)*aux(75)

with precondition: [V=2,V9=1,V10=0,V1>=2,V15>=0]

* Chain [34]: 12*s(452)+1*s(454)+1*s(458)+1*s(459)+1*s(460)+9
Such that:s(454) =< 1
s(453) =< V9+1
aux(76) =< V1
s(452) =< aux(76)
s(457) =< aux(76)
s(458) =< s(452)*s(457)
s(459) =< s(452)*s(453)
s(460) =< s(452)*aux(76)

with precondition: [V=2,V10=0,V1>=2,V9>=2,V15>=0]

* Chain [33]: 1
with precondition: [V1=0,V>=0]

* Chain [32]: 12*s(461)+1*s(464)+1*s(467)+1*s(468)+1*s(469)+8
Such that:s(463) =< V1
aux(77) =< V
s(461) =< aux(77)
s(464) =< s(463)
s(466) =< aux(77)
s(467) =< s(461)*s(466)
s(468) =< s(461)*s(463)
s(469) =< s(461)*aux(77)

with precondition: [V9=0,V>=2,V1>=1,V10+1>=V1]

* Chain [31]: 1*s(470)+1*s(472)+11*s(474)+1*s(476)+1*s(477)+1*s(478)+8
Such that:s(473) =< V
s(470) =< V+V10
s(471) =< V1+V10+1
s(472) =< V10+1
s(474) =< s(473)
s(475) =< s(473)
s(476) =< s(474)*s(475)
s(477) =< s(474)*s(471)
s(478) =< s(474)*s(473)

with precondition: [V9=0,V>=2,V10>=0,V1>=V10+2]


Closed-form bounds of start(V,V1,V9,V10,V15):
-------------------------------------
* Chain [44] with precondition: [V>=0,V1>=0]
- Upper bound: 126*V+48+14*V*V+4*V*nat(V-V9)+22*V1+3*V1*V+nat(V9)*5+ (6*V+6)+nat(V1+V10)*2*nat(V-V9)+ (2*V1+2)*V+nat(V10+1)*6+nat(V10+2)*2+nat(V+V10+1)*3+nat(V1+V10+1)*V+nat(V-V9+V10+1)*3+nat(V-V9+V10)+nat(V-V9)*20
- Complexity: n^2
* Chain [43] with precondition: [V=1,V1>=0,V9>=0,V10>=0,V15>=0]
- Upper bound: 138*V1+61+12*V1*V1+12*V1*nat(V1-V10)+35*V9+3*V9*V1+2*V9*nat(V1-V10)+5*V10+ (3*V1+3)+ (2*V9+2*V15)*nat(V1-V10)+ (V9+1)*V1+ (10*V10+10)+ (12*V15+12)+ (8*V15+16)+ (2*V15+6)+ (3*V1+3*V15+3)+ (3*V1+3*V15+6)+ (V9+V15+1)*V1+ (2*V9+2*V15+2)*nat(V1-V10)+ (V9+V15+2)*V1+nat(V1-V10+V15+1)*6+nat(V1-V10+V15)*2+nat(V1-V10)*64
- Complexity: n^2
* Chain [42] with precondition: [V=1,V1=1,V10=0,V15>=0,V9>=V15+2]
- Upper bound: V15+11
- Complexity: n
* Chain [41] with precondition: [V=1,V9=0,V1>=0,V10>=0,V15>=0]
- Upper bound: 45*V1+35+4*V1*V1+2*V1*nat(V1-V10)+ (3*V1+3)+ (5*V10+5)+nat(V1-V10)*13
- Complexity: n^2
* Chain [40] with precondition: [V=1,V1>=2]
- Upper bound: nat(V10+1)+12
- Complexity: n
* Chain [39] with precondition: [V=1,V10=0,V1>=2,V9>=1,V15+1>=V9]
- Upper bound: 12*V1+9+2*V1*V1+V9+V9*V1
- Complexity: n^2
* Chain [38] with precondition: [V=1,V10=0,V1>=2,V15>=0,V9>=V15+2]
- Upper bound: 11*V1+9+2*V1*V1+ (V1+V15)+ (V15+1)+ (V9+V15+1)*V1
- Complexity: n^2
* Chain [37] with precondition: [V=2,V1>=0,V9>=0,V10>=0,V15>=0]
- Upper bound: 46*V1+33+4*V1*V1+4*V1*nat(V1-V10)+10*V9+V9*V1+2*V9*nat(V1-V10)+5*V10+ (3*V1+3)+ (V9+1)*V1+nat(V1-V10+1)*3+nat(V1-V10)*21
- Complexity: n^2
* Chain [36] with precondition: [V=2,V1=1,V10=0,V9>=2,V15>=0]
- Upper bound: 11
- Complexity: constant
* Chain [35] with precondition: [V=2,V9=1,V10=0,V1>=2,V15>=0]
- Upper bound: 13*V1+10+2*V1*V1
- Complexity: n^2
* Chain [34] with precondition: [V=2,V10=0,V1>=2,V9>=2,V15>=0]
- Upper bound: 12*V1+10+2*V1*V1+ (V9+1)*V1
- Complexity: n^2
* Chain [33] with precondition: [V1=0,V>=0]
- Upper bound: 1
- Complexity: constant
* Chain [32] with precondition: [V9=0,V>=2,V1>=1,V10+1>=V1]
- Upper bound: 12*V+8+2*V*V+V1+V1*V
- Complexity: n^2
* Chain [31] with precondition: [V9=0,V>=2,V10>=0,V1>=V10+2]
- Upper bound: 11*V+8+2*V*V+ (V+V10)+ (V10+1)+ (V1+V10+1)*V
- Complexity: n^2

### Maximum cost of start(V,V1,V9,V10,V15): max([max([max([10,nat(V15+1)+9]),nat(V10+1)+7+max([4,2*V*V+11*V+nat(V+V10)+nat(V1+V10+1)*V])]),V1+7+max([10*V1+1+max([max([2*V1*V1+max([max([nat(V9)*V1+nat(V9),nat(V9+1)*V1+1]),32*V1+23+2*V1*V1+2*V1*nat(V1-V10)+ (3*V1+3)+nat(V1-V10)*13+max([nat(V10+1)*5+2,2*V1*nat(V1-V10)+V1+nat(V9)*10+nat(V9)*V1+nat(V9)*2*nat(V1-V10)+nat(V10)*5+nat(V9+1)*V1+nat(V1-V10)*8+max([nat(V1-V10+1)*3,92*V1+28+8*V1*V1+8*V1*nat(V1-V10)+nat(V9)*25+nat(V9)*2*V1+nat(V9+V15)*2*nat(V1-V10)+nat(V10+1)*10+nat(V15+1)*12+nat(V15+2)*8+nat(V15+3)*2+nat(V1+V15+1)*3+nat(V1+V15+2)*3+nat(V9+V15+1)*V1+nat(V9+V15+1)*2*nat(V1-V10)+nat(V9+V15+2)*V1+nat(V1-V10+V15+1)*6+nat(V1-V10+V15)*2+nat(V1-V10)*43])])+ (V1+1)]),126*V+39+14*V*V+4*V*nat(V-V9)+10*V1+3*V1*V+nat(V9)*5+ (6*V+6)+nat(V1+V10)*2*nat(V-V9)+ (2*V1+2)*V+nat(V10+1)*6+nat(V10+2)*2+nat(V+V10+1)*3+nat(V1+V10+1)*V+nat(V-V9+V10+1)*3+nat(V-V9+V10)+nat(V-V9)*20])+V1,2*V1*V1+nat(V1+V15)+nat(V15+1)+nat(V9+V15+1)*V1]),2*V*V+12*V+V1*V])])+1
Asymptotic class: n^2
* Total analysis performed in 1184 ms.

(10) BOUNDS(1, n^2)